#pragma once


namespace Den{

    struct Dice
    {
        static int Random(int minVal, int maxVal)
        {
            if(minVal>maxVal) 
            {
                const int tmp = minVal;
                minVal = maxVal;
                maxVal = tmp;
            }
            return RND()%(maxVal - minVal + 1) + minVal;
        }
    private: 
        static int GetTick()
        {
            int timeNOW;
            _asm
            {
                rdtsc;
                mov [timeNOW],eax;
            }
            return timeNOW;
        }
        static int RND() 
        { 
            static int seed = GetTick();
            return ( ((seed = seed * 214013L + 2531011L ) >> 16)& 0x7fff);
        }
    };

}//namespace Den